package net.wofly.finance.expense.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.activiti.engine.task.Comment;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wofly.flow.dto.FormPropertyDto;
import net.wofly.right.domain.Organization;
import net.wofly.right.domain.User;

/**
 * 报销单
 * @author lign
 * @version 1.0
 * @created 11-四月-2018 17:30:54
 */
@Data
@Entity
@Table(name = "sale_finance_expense")
@ApiModel(description = "报销单")
public class ExpenseAccount {

	@Id
	private String expenseAccountID;
	/**
	 * 报销申请人
	 */
	@ApiModelProperty(value = "报销申请人", required = true)
	private String askUserID;
	
	@ApiModelProperty(value = "报销申请单编号", required = true)
	private String expenseAccountNO;
	/**
	 * 报销申请事由/开支项目
	 */
	@ApiModelProperty(value = "报销申请事由/开支项目", required = true)
	private String title;
	
	/**
	 * 费用类型
	 */
	@ApiModelProperty(value = "费用类型", required = true)
	private String expenseType;
	
	/**
	 * 详细说明
	 */
	@ApiModelProperty(value = "详细说明", required = false)
	private String descp;
	/**
	 * 报销总额
	 */
	@ApiModelProperty(value = "报销总额", required = true)
	private Double amount;
	/**
	 * 申请人所在部门
	 * 需要将申请人当前所在部门带过来。申请人换机构后，费用结算还在原部门
	 */
	@ApiModelProperty(value = "申请人所在部门", required = false)
	private String orgID;
	/**
	 * 单据张数
	 */
	@ApiModelProperty(value = "单据张数", required = false)
	private Integer proofNum;
	
	/**
	 * 申请单状态
	 */
	@ApiModelProperty(value = "申请单状态", required = false)
	private Integer status;
	
	/**
     * 是否完成
     */
    private Integer isFinish = 0;
	
	/**
	 * 附件数量
	 */
	@ApiModelProperty(value = "附件数量", required = false)
	private Integer attachmentNum;
	
	@ApiModelProperty(value = "申请时间", required = false)
	private Long askTime;
	/**
	 * 批准 
	 */
	@ApiModelProperty(value = "批准时间", required = false)
	private Long approveTime;
	
	private Long modifyDate;
	
	@ApiModelProperty(value = "工作流定义key")
    private String processDefKey ;
    
    @ApiModelProperty(value = "工作流实例ID")
    private String processInsID ;
    
    @ApiModelProperty(value = "工作流任务ID")
    private String taskID ;
    
    @ApiModelProperty(value = "工作流任务名称")
    private String taskName ;
    
    @ApiModelProperty(value = "工作流实例审批意见")
    @Transient
	private List<Comment> comments ;
	
    @ApiModelProperty(value = "任务表单内容")
	@Transient
	private List<FormPropertyDto> formPropertyDtos ;
	
	@ApiModelProperty(value = "上传附件列表", required = false)
	@Transient
	private List<ExpenseAccountAttachment> expenseAccountAttachments;
	
	@ApiModelProperty(value = "报销申请人姓名", required = false)
	@Transient
	private String askUserName;
	
	@ApiModelProperty(value = "报销申请人用户信息", required = false)
	@Transient
	private User askUser;
	
	@ApiModelProperty(value = "报销申请人部门信息", required = false)
	@Transient
	private Organization askUserOrganization ;
	
	@ApiModelProperty(value = "申请人所在部门名称", required = false)
	@Transient
	private String orgName;
	
	@ApiModelProperty(value = "申请单状态名称", required = false)
	@Transient
	private String statusStr;
	
	/**
	 * 费用类型说明
	 */
	@Transient
	@ApiModelProperty(value = "费用类型说明", required = true)
	private String expenseTypeStr;

}//end ExpenseAccount